YES 3.588 H-Termination proof of /home/matraf/haskell/eval_FullyBlown_Fast/List.hs
H-Termination of the given Haskell-Program with start terms could successfully be proven:



HASKELL
  ↳ LR

mainModule List
  ((elemIndex :: Int  ->  [Int ->  Maybe Int) :: Int  ->  [Int ->  Maybe Int)

module List where
  import qualified Maybe
import qualified Prelude

  elemIndex :: Eq a => a  ->  [a ->  Maybe Int
elemIndex x findIndex (== x)

  findIndex :: (a  ->  Bool ->  [a ->  Maybe Int
findIndex p Maybe.listToMaybe . findIndices p

  findIndices :: (a  ->  Bool ->  [a ->  [Int]
findIndices p xs concatMap (\vv1 ->
case vv1 of
  (x,i)->  if p x then i : [] else []
  _-> []
) (zip xs (enumFrom 0))


module Maybe where
  import qualified List
import qualified Prelude

  listToMaybe :: [a ->  Maybe a
listToMaybe [] Nothing
listToMaybe (a : _) Just a



Lambda Reductions:
The following Lambda expression
\vv1
case vv1 of
 (x,i) → if p x then i : [] else []
 _ → []

is transformed to
findIndices0 p vv1 = 
case vv1 of
 (x,i) → if p x then i : [] else []
 _ → []

The following Lambda expression
\ab→(a,b)

is transformed to
zip0 a b = (a,b)



↳ HASKELL
  ↳ LR
HASKELL
      ↳ CR

mainModule List
  ((elemIndex :: Int  ->  [Int ->  Maybe Int) :: Int  ->  [Int ->  Maybe Int)

module List where
  import qualified Maybe
import qualified Prelude

  elemIndex :: Eq a => a  ->  [a ->  Maybe Int
elemIndex x findIndex (== x)

  findIndex :: (a  ->  Bool ->  [a ->  Maybe Int
findIndex p Maybe.listToMaybe . findIndices p

  findIndices :: (a  ->  Bool ->  [a ->  [Int]
findIndices p xs concatMap (findIndices0 p) (zip xs (enumFrom 0))

  
findIndices0 p vv1 
case vv1 of
  (x,i)->  if p x then i : [] else []
  _-> []


module Maybe where
  import qualified List
import qualified Prelude

  listToMaybe :: [a ->  Maybe a
listToMaybe [] Nothing
listToMaybe (a : _) Just a



Case Reductions:
The following Case expression
case vv1 of
 (x,i) → if p x then i : [] else []
 _ → []

is transformed to
findIndices00 p (x,i) = if p x then i : [] else []
findIndices00 p _ = []



↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ CR
HASKELL
          ↳ IFR

mainModule List
  ((elemIndex :: Int  ->  [Int ->  Maybe Int) :: Int  ->  [Int ->  Maybe Int)

module List where
  import qualified Maybe
import qualified Prelude

  elemIndex :: Eq a => a  ->  [a ->  Maybe Int
elemIndex x findIndex (== x)

  findIndex :: (a  ->  Bool ->  [a ->  Maybe Int
findIndex p Maybe.listToMaybe . findIndices p

  findIndices :: (a  ->  Bool ->  [a ->  [Int]
findIndices p xs concatMap (findIndices0 p) (zip xs (enumFrom 0))

  
findIndices0 p vv1 findIndices00 p vv1

  
findIndices00 p (x,i if p x then i : [] else []
findIndices00 p _ []


module Maybe where
  import qualified List
import qualified Prelude

  listToMaybe :: [a ->  Maybe a
listToMaybe [] Nothing
listToMaybe (a : _) Just a



If Reductions:
The following If expression
if p x then i : [] else []

is transformed to
findIndices000 i True = i : []
findIndices000 i False = []



↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ CR
        ↳ HASKELL
          ↳ IFR
HASKELL
              ↳ BR

mainModule List
  ((elemIndex :: Int  ->  [Int ->  Maybe Int) :: Int  ->  [Int ->  Maybe Int)

module List where
  import qualified Maybe
import qualified Prelude

  elemIndex :: Eq a => a  ->  [a ->  Maybe Int
elemIndex x findIndex (== x)

  findIndex :: (a  ->  Bool ->  [a ->  Maybe Int
findIndex p Maybe.listToMaybe . findIndices p

  findIndices :: (a  ->  Bool ->  [a ->  [Int]
findIndices p xs concatMap (findIndices0 p) (zip xs (enumFrom 0))

  
findIndices0 p vv1 findIndices00 p vv1

  
findIndices00 p (x,ifindIndices000 i (p x)
findIndices00 p _ []

  
findIndices000 i True i : []
findIndices000 i False []


module Maybe where
  import qualified List
import qualified Prelude

  listToMaybe :: [a ->  Maybe a
listToMaybe [] Nothing
listToMaybe (a : _) Just a



Replaced joker patterns by fresh variables and removed binding patterns.

↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ CR
        ↳ HASKELL
          ↳ IFR
            ↳ HASKELL
              ↳ BR
HASKELL
                  ↳ COR

mainModule List
  ((elemIndex :: Int  ->  [Int ->  Maybe Int) :: Int  ->  [Int ->  Maybe Int)

module List where
  import qualified Maybe
import qualified Prelude

  elemIndex :: Eq a => a  ->  [a ->  Maybe Int
elemIndex x findIndex (== x)

  findIndex :: (a  ->  Bool ->  [a ->  Maybe Int
findIndex p Maybe.listToMaybe . findIndices p

  findIndices :: (a  ->  Bool ->  [a ->  [Int]
findIndices p xs concatMap (findIndices0 p) (zip xs (enumFrom 0))

  
findIndices0 p vv1 findIndices00 p vv1

  
findIndices00 p (x,ifindIndices000 i (p x)
findIndices00 p vw []

  
findIndices000 i True i : []
findIndices000 i False []


module Maybe where
  import qualified List
import qualified Prelude

  listToMaybe :: [a ->  Maybe a
listToMaybe [] Nothing
listToMaybe (a : vxJust a



Cond Reductions:
The following Function with conditions
undefined 
 | False
 = undefined

is transformed to
undefined  = undefined1

undefined0 True = undefined

undefined1  = undefined0 False



↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ CR
        ↳ HASKELL
          ↳ IFR
            ↳ HASKELL
              ↳ BR
                ↳ HASKELL
                  ↳ COR
HASKELL
                      ↳ NumRed

mainModule List
  ((elemIndex :: Int  ->  [Int ->  Maybe Int) :: Int  ->  [Int ->  Maybe Int)

module List where
  import qualified Maybe
import qualified Prelude

  elemIndex :: Eq a => a  ->  [a ->  Maybe Int
elemIndex x findIndex (== x)

  findIndex :: (a  ->  Bool ->  [a ->  Maybe Int
findIndex p Maybe.listToMaybe . findIndices p

  findIndices :: (a  ->  Bool ->  [a ->  [Int]
findIndices p xs concatMap (findIndices0 p) (zip xs (enumFrom 0))

  
findIndices0 p vv1 findIndices00 p vv1

  
findIndices00 p (x,ifindIndices000 i (p x)
findIndices00 p vw []

  
findIndices000 i True i : []
findIndices000 i False []


module Maybe where
  import qualified List
import qualified Prelude

  listToMaybe :: [a ->  Maybe a
listToMaybe [] Nothing
listToMaybe (a : vxJust a



Num Reduction: All numbers are transformed to thier corresponding representation with Pos, Neg, Succ and Zero.

↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ CR
        ↳ HASKELL
          ↳ IFR
            ↳ HASKELL
              ↳ BR
                ↳ HASKELL
                  ↳ COR
                    ↳ HASKELL
                      ↳ NumRed
HASKELL
                          ↳ Narrow

mainModule List
  (elemIndex :: Int  ->  [Int ->  Maybe Int)

module List where
  import qualified Maybe
import qualified Prelude

  elemIndex :: Eq a => a  ->  [a ->  Maybe Int
elemIndex x findIndex (== x)

  findIndex :: (a  ->  Bool ->  [a ->  Maybe Int
findIndex p Maybe.listToMaybe . findIndices p

  findIndices :: (a  ->  Bool ->  [a ->  [Int]
findIndices p xs concatMap (findIndices0 p) (zip xs (enumFrom (Pos Zero)))

  
findIndices0 p vv1 findIndices00 p vv1

  
findIndices00 p (x,ifindIndices000 i (p x)
findIndices00 p vw []

  
findIndices000 i True i : []
findIndices000 i False []


module Maybe where
  import qualified List
import qualified Prelude

  listToMaybe :: [a ->  Maybe a
listToMaybe [] Nothing
listToMaybe (a : vxJust a



Haskell To QDPs


↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ CR
        ↳ HASKELL
          ↳ IFR
            ↳ HASKELL
              ↳ BR
                ↳ HASKELL
                  ↳ COR
                    ↳ HASKELL
                      ↳ NumRed
                        ↳ HASKELL
                          ↳ Narrow
                            ↳ AND
QDP
                                ↳ QDPSizeChangeProof
                              ↳ QDP
                              ↳ QDP
                              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

new_listToMaybe0(wz13, :(wz41110, wz41111)) → new_listToMaybe(wz41110, wz41111, new_primPlusNat(wz13), new_primPlusNat(wz13))
new_listToMaybe(Neg(Succ(wz411000)), wz4111, wz13, wz14) → new_listToMaybe0(wz13, wz4111)
new_listToMaybe(Pos(Succ(wz411000)), :(wz41110, wz41111), wz13, wz14) → new_listToMaybe(wz41110, wz41111, new_primPlusNat(wz13), new_primPlusNat(wz13))

The TRS R consists of the following rules:

new_primPlusNat(Zero) → Succ(Zero)
new_primPlusNat0(Succ(wz1200)) → Succ(wz1200)
new_primPlusNat(Succ(wz120)) → Succ(Succ(new_primPlusNat0(wz120)))
new_primPlusNat0(Zero) → Zero

The set Q consists of the following terms:

new_primPlusNat0(Succ(x0))
new_primPlusNat(Zero)
new_primPlusNat0(Zero)
new_primPlusNat(Succ(x0))

We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ CR
        ↳ HASKELL
          ↳ IFR
            ↳ HASKELL
              ↳ BR
                ↳ HASKELL
                  ↳ COR
                    ↳ HASKELL
                      ↳ NumRed
                        ↳ HASKELL
                          ↳ Narrow
                            ↳ AND
                              ↳ QDP
QDP
                                ↳ QDPSizeChangeProof
                              ↳ QDP
                              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

new_listToMaybe2(wz55, Zero, Succ(wz570), wz58, wz59, wz60) → new_listToMaybe4(wz55, wz58, wz59, wz60)
new_listToMaybe1(wz300, Neg(Zero), wz4111, wz12, wz11) → new_listToMaybe3(wz12, wz300, wz4111)
new_listToMaybe4(wz55, wz58, :(wz590, wz591), wz60) → new_listToMaybe1(wz58, wz590, wz591, wz60, wz60)
new_listToMaybe1(wz300, Neg(Succ(wz411000)), wz4111, wz12, wz11) → new_listToMaybe2(new_primPlusNat(wz12), wz300, wz411000, wz300, wz4111, new_primPlusNat(wz12))
new_listToMaybe1(wz300, Pos(wz41100), :(wz41110, wz41111), wz12, wz11) → new_listToMaybe1(wz300, wz41110, wz41111, new_primPlusNat(wz12), new_primPlusNat(wz12))
new_listToMaybe2(wz55, Succ(wz560), Succ(wz570), wz58, wz59, wz60) → new_listToMaybe2(wz55, wz560, wz570, wz58, wz59, wz60)
new_listToMaybe3(wz12, wz300, :(wz41110, wz41111)) → new_listToMaybe1(wz300, wz41110, wz41111, new_primPlusNat(wz12), new_primPlusNat(wz12))
new_listToMaybe2(wz55, Succ(wz560), Zero, wz58, :(wz590, wz591), wz60) → new_listToMaybe1(wz58, wz590, wz591, wz60, wz60)

The TRS R consists of the following rules:

new_primPlusNat(Zero) → Succ(Zero)
new_primPlusNat0(Succ(wz1200)) → Succ(wz1200)
new_primPlusNat(Succ(wz120)) → Succ(Succ(new_primPlusNat0(wz120)))
new_primPlusNat0(Zero) → Zero

The set Q consists of the following terms:

new_primPlusNat0(Succ(x0))
new_primPlusNat(Zero)
new_primPlusNat0(Zero)
new_primPlusNat(Succ(x0))

We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ CR
        ↳ HASKELL
          ↳ IFR
            ↳ HASKELL
              ↳ BR
                ↳ HASKELL
                  ↳ COR
                    ↳ HASKELL
                      ↳ NumRed
                        ↳ HASKELL
                          ↳ Narrow
                            ↳ AND
                              ↳ QDP
                              ↳ QDP
QDP
                                ↳ QDPSizeChangeProof
                              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

new_listToMaybe5(Neg(Succ(wz4111000)), wz41111, wz48, wz47) → new_listToMaybe6(wz47, wz41111, wz47)
new_listToMaybe5(Pos(Succ(wz4111000)), wz41111, wz48, wz47) → new_listToMaybe6(wz47, wz41111, wz47)
new_listToMaybe6(wz35, :(wz41110, wz41111), wz36) → new_listToMaybe5(wz41110, wz41111, new_primPlusNat(wz36), new_primPlusNat(wz36))

The TRS R consists of the following rules:

new_primPlusNat(Zero) → Succ(Zero)
new_primPlusNat0(Succ(wz1200)) → Succ(wz1200)
new_primPlusNat(Succ(wz120)) → Succ(Succ(new_primPlusNat0(wz120)))
new_primPlusNat0(Zero) → Zero

The set Q consists of the following terms:

new_primPlusNat0(Succ(x0))
new_primPlusNat(Zero)
new_primPlusNat0(Zero)
new_primPlusNat(Succ(x0))

We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ CR
        ↳ HASKELL
          ↳ IFR
            ↳ HASKELL
              ↳ BR
                ↳ HASKELL
                  ↳ COR
                    ↳ HASKELL
                      ↳ NumRed
                        ↳ HASKELL
                          ↳ Narrow
                            ↳ AND
                              ↳ QDP
                              ↳ QDP
                              ↳ QDP
QDP
                                ↳ QDPSizeChangeProof

Q DP problem:
The TRS P consists of the following rules:

new_listToMaybe8(wz45, wz300, :(wz411110, wz411111)) → new_listToMaybe9(wz300, wz411110, wz411111, wz45, wz45)
new_listToMaybe10(wz300, Pos(Zero), wz41111, wz46, wz45) → new_listToMaybe8(wz45, wz300, wz41111)
new_listToMaybe9(wz300, wz41110, wz41111, wz41, wz42) → new_listToMaybe10(wz300, wz41110, wz41111, new_primPlusNat(wz41), new_primPlusNat(wz41))
new_listToMaybe7(wz66, Succ(wz670), Succ(wz680), wz69, wz70) → new_listToMaybe7(wz66, wz670, wz680, wz69, wz70)
new_listToMaybe10(wz300, Neg(wz411100), :(wz411110, wz411111), wz46, wz45) → new_listToMaybe9(wz300, wz411110, wz411111, wz45, wz45)
new_listToMaybe7(wz66, Succ(wz670), Zero, wz69, wz70) → new_listToMaybe8(wz66, wz69, wz70)
new_listToMaybe7(wz66, Zero, Succ(wz680), wz69, wz70) → new_listToMaybe8(wz66, wz69, wz70)
new_listToMaybe10(wz300, Pos(Succ(wz4111000)), wz41111, wz46, wz45) → new_listToMaybe7(wz45, wz300, wz4111000, wz300, wz41111)

The TRS R consists of the following rules:

new_primPlusNat(Zero) → Succ(Zero)
new_primPlusNat0(Succ(wz1200)) → Succ(wz1200)
new_primPlusNat(Succ(wz120)) → Succ(Succ(new_primPlusNat0(wz120)))
new_primPlusNat0(Zero) → Zero

The set Q consists of the following terms:

new_primPlusNat0(Succ(x0))
new_primPlusNat(Zero)
new_primPlusNat0(Zero)
new_primPlusNat(Succ(x0))

We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs: